import {ModalForm, ProFormText} from '@ant-design/pro-components';
import {Form} from 'antd';

export interface FormValueType extends Partial<API.SettingSslPath> {
  target?: string;
  template?: string;
  type?: string;
  time?: string;
  frequency?: string;
}


export interface EditFormProps {
  onOpenChange: (flag?: boolean, formVals?: FormValueType) => void;
  onSubmit: (values: FormValueType) => Promise<void>;
  editModalVisible: boolean;
  values: Partial<API.SettingSslPath>;
}


export default (props:EditFormProps) => {
  const [form] = Form.useForm();


  return (
      <ModalForm
        title= {props.values.sslPath === null ? "设置sslPath": '修改sslPath'}
        open={props.editModalVisible}
        onOpenChange={props.onOpenChange}
        onFinish={props.onSubmit}
        initialValues={props.values}
        form={form}
    >
       <ProFormText
        width="md"
        name="id"
        label="Id"
        hidden={true}
        disabled={true}
      />
     <ProFormText
        width="md"
        name="sslPath"
        label="证书地址"
      />
    </ModalForm>
  );
};
